package com.raowb.common.util;

import cn.hutool.core.util.ArrayUtil;

/**
 * 
* @Description:
* @author:raowenbiao
* @date 2019年7月2日 下午1:50:04
 */
public class FileUtil extends cn.hutool.core.io.FileUtil{

	private static String[] imgExtArry = "bmp,jpg,jepg,png,gif,pcx,tga,exif,fpx,svg,psd,eps,ai,raw".split(",");
	
	public static String getTypeByExt(String fileName) {
		
		if(ArrayUtil.contains(imgExtArry,getFileExt(fileName))){
			return "img";
		}
		
		return "file";
	}
	
	public static String getFileExt(String fileName) {
		
		String fileExt = StringUtil.subAfter(fileName, ".", true);
		fileExt = StringUtil.lowerCase(fileExt);		
		return fileExt;
	}
	
	
	
	
}
